import net.bytebuddy.matcher.DeclaringFieldMatcher;
import org.junit.Test;
import org.malred.hospital.entity.TbOrder;
import org.malred.hospital.utils.ConstValues;

import java.lang.reflect.Field;
import java.util.regex.Pattern;

public class reflect {
    @Test
    public void t() {
        Class<? extends TbOrder> aClass = new TbOrder().getClass();
        for (Field declaredField : aClass.getDeclaredFields()) {
            System.out.println(declaredField.getName());
            System.out.println(declaredField.getType().getSimpleName());
        }
    }

    @Test
    public void re() {
        // 包含字母
        String pattern1 = "^(?=.*[a-zA-Z]).{8,16}$";
        // 包含数字
        String pattern2 = "^(?=.*\\d).{8,16}$";
        // 包含特殊符号
        String pattern3 = "^(?=.*[^\\da-zA-Z\\s]).{8,16}$";

        System.out.println("username".matches(pattern1));
        System.out.println("username".matches(pattern2));
        System.out.println("username".matches(pattern3));

        System.out.println("张三".matches(ConstValues.CN_CHAT_REGEX));
        System.out.println("!@".matches(ConstValues.OTHER_CHAT_REGEX));
        System.out.println("#$%&&".matches(ConstValues.OTHER_CHAT_REGEX));
        System.out.println("张三".matches(ConstValues.OTHER_CHAT_REGEX));
    }
}
